:root {
    --parchment: #f4e9d8;
    --parchment-dark: #d4c4a8;
    --ink: #2c2416;
    --gold: #c9a961;
    --gold-dark: #9d7d3a;
    --burgundy: #6b2737;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background-color: var(--parchment);
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.7;
}

/* Texture de parchemin */
.parchment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(44, 36, 22, 0.015) 2px,
            rgba(44, 36, 22, 0.015) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* Bouton retour */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--gold);
    color: var(--burgundy);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.back-button:hover {
    background: var(--gold);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.4);
}

.header {
    text-align: center;
    padding: 80px 20px 40px;
    position: relative;
    z-index: 2;
    border-bottom: 2px solid var(--gold);
    background: linear-gradient(to bottom, var(--parchment) 0%, rgba(201, 169, 97, 0.05) 100%);
}

.ornament {
    font-size: 2.5rem;
    color: var(--gold);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

.ornament-left {
    left: 20px;
}

.ornament-right {
    right: 20px;
}

.title-container {
    max-width: 800px;
    margin: 0 auto;
}

.main-title {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 3.5rem;
    color: var(--burgundy);
    letter-spacing: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px rgba(201, 169, 97, 0.3);
}

.subtitle {
    font-family: 'Crimson Text', serif;
    font-size: 1.3rem;
    color: var(--gold-dark);
    font-style: italic;
    letter-spacing: 2px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 2;
}

/* Section de recherche */
.search-section {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.6);
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--gold);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--burgundy);
    box-shadow: 0 0 0 3px rgba(107, 39, 55, 0.1);
}

.clear-btn {
    padding: 15px 20px;
    background: var(--burgundy);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.clear-btn:hover {
    background: #8b3547;
    transform: scale(1.05);
}

.results-count {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--burgundy);
    font-weight: 600;
}

.results-count span {
    color: var(--gold-dark);
    font-weight: 700;
}

/* Tableau des talents */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(44, 36, 22, 0.15);
}

.talents-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Crimson Text', serif;
}

.talents-table thead {
    background: linear-gradient(135deg, var(--burgundy), #8b3547);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.talents-table th {
    padding: 18px 15px;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.talents-table th:last-child {
    border-right: none;
}

.talents-table tbody tr {
    border-bottom: 1px solid #e0d5c0;
    transition: all 0.2s ease;
}

.talents-table tbody tr:hover {
    background: rgba(201, 169, 97, 0.1);
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(44, 36, 22, 0.1);
}

.talents-table tbody tr:nth-child(even) {
    background: rgba(244, 233, 216, 0.3);
}

.talents-table tbody tr:nth-child(even):hover {
    background: rgba(201, 169, 97, 0.15);
}

.talents-table td {
    padding: 15px;
    vertical-align: top;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Colonnes spécifiques */
.col-nom {
    width: 15%;
    min-width: 150px;
}

.col-condition {
    width: 15%;
    min-width: 150px;
}

.col-effet {
    width: 35%;
    min-width: 300px;
}

.col-categorie {
    width: 12%;
    min-width: 120px;
}

.col-sous-categorie {
    width: 18%;
    min-width: 180px;
}

.col-cout {
    width: 5%;
    min-width: 80px;
    text-align: center;
}

/* Styles des cellules */
.talent-nom {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--burgundy);
    font-size: 1.05rem;
}

.talent-condition {
    font-style: italic;
    color: var(--gold-dark);
    font-size: 0.9rem;
}

.talent-effet {
    color: var(--ink);
    line-height: 1.7;
}

.talent-categorie {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
}

.cat-offensif {
    background: rgba(180, 50, 50, 0.15);
    color: #b43232;
    border: 1px solid #b43232;
}

.cat-defensif {
    background: rgba(50, 100, 180, 0.15);
    color: #3264b4;
    border: 1px solid #3264b4;
}

.cat-reaction {
    background: rgba(180, 140, 50, 0.15);
    color: #b48c32;
    border: 1px solid #b48c32;
}

.cat-magie {
    background: rgba(130, 50, 180, 0.15);
    color: #8232b4;
    border: 1px solid #8232b4;
}

.cat-autre {
    background: rgba(80, 80, 80, 0.15);
    color: #505050;
    border: 1px solid #505050;
}

.talent-sous-categorie {
    color: var(--gold-dark);
    font-size: 0.85rem;
}

.talent-cout {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--burgundy);
    text-align: center;
}

/* Aucun résultat */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border: 2px dashed var(--gold);
}

.no-results p {
    font-size: 1.5rem;
    color: var(--burgundy);
    margin-bottom: 10px;
}

.no-results-hint {
    font-size: 1.1rem;
    color: var(--gold-dark);
    font-style: italic;
}

/* Colonnes triables */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s ease;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
    display: inline-block;
    margin-left: 5px;
    opacity: 0.5;
    font-size: 0.8rem;
}

.sortable.active .sort-icon {
    opacity: 1;
}

.sortable.asc .sort-icon::before {
    content: '▲';
    opacity: 1;
}

.sortable.desc .sort-icon::before {
    content: '▼';
    opacity: 1;
}

.sortable.asc .sort-icon,
.sortable.desc .sort-icon {
    display: none;
}

.sortable.asc .sort-icon::before,
.sortable.desc .sort-icon::before {
    display: inline;
}

/* Surlignage de recherche */
.highlight {
    background-color: #ffeb3b;
    color: #000;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px 30px;
    position: relative;
    z-index: 2;
}

.divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 0 auto 20px;
}

.footer p {
    font-size: 0.95rem;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 30px 15px 60px;
    }

    .table-wrapper {
        border-radius: 8px;
    }

    .talents-table th,
    .talents-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .talent-nom {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .back-button {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .header {
        padding: 70px 15px 30px;
    }

    .main-title {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .ornament {
        font-size: 1.8rem;
    }

    .search-section {
        padding: 20px 15px;
    }

    .search-bar {
        flex-direction: column;
    }

    #searchInput {
        font-size: 1rem;
        padding: 12px 15px;
    }

    .clear-btn {
        padding: 12px;
    }

    /* Table mobile - stacked view */
    .talents-table thead {
        display: none;
    }

    .talents-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 2px solid var(--gold);
        border-radius: 8px;
        padding: 15px;
        background: white;
    }

    .talents-table td {
        display: block;
        padding: 8px 0;
        border: none;
    }

    .talents-table td::before {
        content: attr(data-label);
        font-family: 'Cinzel', serif;
        font-weight: 700;
        color: var(--burgundy);
        display: block;
        margin-bottom: 5px;
    }

    .talent-cout {
        text-align: left;
    }
}